package com.atguigu.singleton.type8;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description:
 * @create: 2022-01-16 15:58
 **/
public class SingleTonTest {
    public static void main(String[] args) {
        Singleton instance1 = Singleton.INSTANCE;
        Singleton instance2 = Singleton.INSTANCE;
        System.out.println(instance1 == instance2);

        System.out.println(instance1.hashCode());
        System.out.println(instance2.hashCode());

        instance1.sayOk();
        instance2.sayOk();
    }
}
